<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>站点管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/mt/sysNews/list">广告列表</a></li>
		<li class="active"><a href="${ctx}/mt/sysNews/form?id=${sysNews.id}">站点${not empty tNews.id?'修改':'添加'}查看</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="sysNews" action="${ctx}/mt/sysNews/save" method="post" class="form-horizontal">
		<form:hidden path="rid"/>
		<form:hidden path="contents" value = "0"/>
		<form:hidden path="accept" value = "1"/>
		<sys:message content="${message}"/>
		
		<div class="control-group">
			<label class="control-label">广告标题:</label>
			<div class="controls">
				<form:input path="titles" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">广告位置:</label>
			<div class="controls">
					<sys:treeselect id="tType"  name="ctype" value="${sysNews.ctype}" labelName="parent.name" labelValue="${sysNews.typeName}"
					title="父级节点" url="/admin/sysType/treeData" extId="${tType.id}" cssClass="input-xlarge required" allowClear="true" />
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">广告尺寸:</label>
			<div class="controls">
				<form:input path="keyword" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">广告链接:</label>
			<div class="controls">
				<form:input path="origin" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">广告排序:</label>
			<div class="controls">
				<form:input path="ctypeB" htmlEscape="false" maxlength="10" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">广告图片:</label>
			<div class="controls">
				<form:hidden path="picname" htmlEscape="false" maxlength="255" class="input-xlarge"/>
				<sys:ckImage input="picname" type="images" uploadPath="/cms/site"/>
				<span class="help-inline">建议Logo大小：1000 × 145（像素）</span>
			</div>
		</div>
		
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>